x86, hvm: fix get msix entry error
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 6 Jul 2009 10:58:02 +0000 (11:58 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 6 Jul 2009 10:58:02 +0000 (11:58 +0100)
There is a mistake to get the msix entry number. It should be
divide instead of modulus.

Signed-off-by: Yang Zhang <yang.zhang@intel.com>
Signed-off-by: Qing He <qing.he@intel.com>
xen/arch/x86/hvm/vmsi.c

index 37c1e5c14f8544d67eb5d1895dc75659273c7c3d..e6bc057dcdcebfa2b6176faccd93c8bd986ba1df 100644 (file)
@@ -290,7 +290,7 @@ static int msixtbl_write(struct vcpu *v, unsigned long address,
         goto out;
 
     entry = msixtbl_find_entry(v, address);
-    nr_entry = (address - entry->gtable) % PCI_MSIX_ENTRY_SIZE;
+    nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE;
 
     offset = address & (PCI_MSIX_ENTRY_SIZE - 1);
     if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET)